package com.young.weixin.model;

/**
 * 微信消息体
 * @author wangjiyu@imdada.cn
 * @create 2019/5/5
 */
public class WxMessageRequest {
    //下面这4个参数是基础配置接口中的4个参数

    /**
     * 微信加密签名，signature结合了开发者填写的token参数和请求中的timestamp参数、nonce参数。
     */
    private String signature;
    /**
     * 时间戳
     */
    private String timestamp;
    /**
     * 随机数
     */
    private String nonce;
    /**
     * 随机字符串
     */
    private String echostr;

    //下面的参数是微信业务接口参数

    /**
     * 加密类型
     */
    private String encrypt_type;
    /**
     * 消息密文
     */
    private String msg_signature;

    /**
     * 用户openid
     */
    private String openid;

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder("{");
        sb.append("\"signature\":").append(signature != null ? "\"" : "").append(signature).append(signature != null ? "\"" : "");
        sb.append(", \"timestamp\":").append(timestamp != null ? "\"" : "").append(timestamp).append(timestamp != null ? "\"" : "");
        sb.append(", \"nonce\":").append(nonce != null ? "\"" : "").append(nonce).append(nonce != null ? "\"" : "");
        sb.append(", \"echostr\":").append(echostr != null ? "\"" : "").append(echostr).append(echostr != null ? "\"" : "");
        sb.append(", \"encrypt_type\":").append(encrypt_type != null ? "\"" : "").append(encrypt_type).append(encrypt_type != null ? "\"" : "");
        sb.append(", \"msg_signature\":").append(msg_signature != null ? "\"" : "").append(msg_signature).append(msg_signature != null ? "\"" : "");
        sb.append(", \"openid\":").append(openid != null ? "\"" : "").append(openid).append(openid != null ? "\"" : "");
        sb.append('}');
        return sb.toString();
    }

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public String getEncrypt_type() {
        return encrypt_type;
    }

    public void setEncrypt_type(String encrypt_type) {
        this.encrypt_type = encrypt_type;
    }

    public String getMsg_signature() {
        return msg_signature;
    }

    public void setMsg_signature(String msg_signature) {
        this.msg_signature = msg_signature;
    }

    public String getSignature() {
        return signature;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }

    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    public String getNonce() {
        return nonce;
    }

    public void setNonce(String nonce) {
        this.nonce = nonce;
    }

    public String getEchostr() {
        return echostr;
    }

    public void setEchostr(String echostr) {
        this.echostr = echostr;
    }
}
